<?php
/**
 * Created by PhpStorm.
 * User: admin
 * Date: 2017/9/20
 * Time: 16:15
 */

namespace frontend\controllers;

use yii;
use yii\web\Controller;

class BaseController extends Controller{

    public function init(){
        parent::init();

        /*初始化购物车内数量与总金额*/

        if(yii::$app->user->isGuest){
            $this->redirect(['/site/login']);
        }
    }
}